Skip to content

Add hostname to lockfile dependencies - #29

Merged
nodeselector merged 5 commits into
github:mainfrom
kaibocai:kaibocai-hostname-lockfile-schema
Sep 8, 2026
Merged

Add hostname to lockfile dependencies#29
nodeselector merged 5 commits into
github:mainfrom
kaibocai:kaibocai-hostname-lockfile-schema

Conversation

@kaibocai

@kaibocai kaibocai commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add lockfile schema v0.0.3 with an optional canonical hostname on each dependency
  • accept explicit hostnames only as github.com or a lowercase <tenant>.ghe.com hostname
  • preserve hostnames supplied by v0.0.3 producers while allowing dotcom-only files to omit the field
  • normalize v0.0.1 and v0.0.2 dependencies to github.com in memory without changing either published schema or the source lockfile
  • keep scoped validation correct across canonical pin casing and the full reachable Action.Uses graph
  • retain v0.0.2 benchmarks alongside v0.0.3 for compatibility and performance comparisons

This is the first actions-lockfile step for github/actions-dispatch#1126. Hostname-aware Proxima producers will record the resolved hostname for every direct and transitive dependency. Reader support still needs to roll out before gh-actions-lock starts writing v0.0.3.

Testing

  • go test ./... -count=1
  • go vet ./...
  • bash script/release_test

kaibocai and others added 2 commits September 4, 2026 14:53
Introduce lockfile schema v0.0.3 with a required canonical hostname on every dependency. Preserve hostnames from new lockfiles and default v0.0.1/v0.0.2 dotcom-only entries to github.com in memory.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Ensure equivalent pin casing cannot skip required action-field checks during scoped parsing.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 4, 2026 20:30
@kaibocai
kaibocai requested a review from a team as a code owner September 4, 2026 20:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Null dependency values can bypass required hostname validation, including during scoped parsing.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity go/​pkg/​lockfile/​compat.go — A referenced dependency with a null YAML value bypasses all required-field validation: yaml.v3
What changed in this PR

Adds lockfile schema v0.0.3 with per-dependency hostnames while retaining compatibility with earlier schemas.

Changes:

  • Adds and embeds the v0.0.3 schema.
  • Preserves v0.0.3 hostnames and defaults legacy files to github.com.
  • Updates scoped validation, tests, benchmarks, and documentation.
File Description
schema/​lockfile-v0.0.3.json Defines schema v0.0.3.
README.md Documents hostname support.
go/​pkg/​lockfile/​schema.go Exposes the latest schema.
go/​pkg/​lockfile/​schema_test.go Tests schema and hostname validation.
go/​pkg/​lockfile/​schema_gen.go Embeds the generated schema.
go/​pkg/​lockfile/​lockfile.go Adds hostname metadata and validation.
go/​pkg/​lockfile/​internal/​cmd/​genschema/​main.go Generates all schema constants.
go/​pkg/​lockfile/​compat.go Adds v0.0.3 and legacy migration support.
go/​pkg/​lockfile/​compat_test.go Tests compatibility behavior.
go/​pkg/​lockfile/​bench_test.go Updates benchmarks for v0.0.3.
Files not reviewed (2)
  • go/pkg/lockfile/internal/cmd/genschema/main.go: Generated file
  • go/pkg/lockfile/schema_gen.go: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread go/pkg/lockfile/compat.go
kaibocai and others added 2 commits September 4, 2026 16:04
Traverse each selected workflow's reachable uses graph before applying schema-specific dependency validation. Reject malformed dependency bodies and non-string hostnames while preserving scoped fail-open behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Allow dotcom-only v0.0.3 lockfiles to omit hostname while retaining strict validation when the field is present. Preserve legacy normalization and scoped graph validation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2f6db8ef-20bf-421d-878b-6d044d3865ea
Comment thread go/pkg/lockfile/bench_test.go
Comment thread schema/lockfile-v0.0.3.json
Accept only github.com or canonical GHE tenant hostnames when hostname is present. Restore the v0.0.2 benchmark baseline alongside v0.0.3 for compatibility comparisons.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2f6db8ef-20bf-421d-878b-6d044d3865ea
@nodeselector
nodeselector merged commit eda2ce3 into github:main Sep 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants